This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
If you really need the user to click specific buttons or actions to either edit or save the document, then, as suggested by others, the use of hidden fields you set with the edit or save buttons and then check at the point of save works fine.
Actually if you go into the 4/5 forum and search for 'prevent esc save' you'll get a couple of hits.
If you build your app so users can't go around the workflow, then you're golden. If, on the other hand, you don't go through the effort to trap out things like private agents/user smart icons (*), there are a couple of things to keep in mind. First, if they start setting values out side of the workflow, it's highly unlikely they'll know all the fields to set and what values to use so the workflow will either go the wrong way (and people will notice and call you) or the workflow will stop (and people will notice and call you). If you use Audit Manager from OpenNTF, you can set up audit trails and keep track of who did what when without much effort at all. Audit trails are hugely helpful for debugging things like app design issues and user 'creativity'. I cannot recommend Audit Manager (and the underlying TriggerHappy code it implements) highly enough - this is simply an awesome app.
Doug
(*) Maybe my end users are not highly motivated but I have yet to have anyone spend the time to build private code to go around an app design. YMMV.
I went poking around my code bin and found the following. I don't have the origninal author so my apologies.:
Force use of 'edit' button and disable double click to edit.
Add an edit button to your form containing:
Add a QueryModeChange event to the form that contains:
Sub Querymodechange(Source As Notesuidocument, Continue As Variant)
Dim Session As New NotesSession
If Session.GetEnvironmentString("EditLock") = "UnLocked" Then
Continue = True
Else
Continue = False
End If
Double clicking doesn't set the Env variable so the change to edit mode fails.
You'll likely want to add in other code to either prevent the user from <esc>aping out (which won't reset the Env Var) or add code into the QueryClose event to reset the lock flag.
And if you're really interested, I actually have code from 1998 and the old Notes-L listserver...there really isn't much new on the face of this earth!